macclassicserial.htmlHTMLudog%›πùΔ£πùΔ£Åʼn  Monkeybread Realbasic plugin - Documentation - MacClassicSerial

MBS Plugin Documentation

This is the documentation for the Realbasic Plugins from Monkeybreadsoftware.de. You find these plugins and the newest version of this document at http://www.monkeybreadsoftware.de/realbasic inside the plugins section.

This help was last updated on Freitag, 6. September 2002 and covers 2136 items: 126 classes, 2 controls and 583 global functions.

The list of the themes Global methods by category Global methods by name The list of the classes The list of the controls

class MacClassicSerial

class, Serial Port Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: does nothing. Windows: does nothing.
Function: Gives access to Aliases on Mac.
Notes:
a class to replace Realbasic's Serial class for some things.
This class can work with speeds faster than Realbasic's Serial control. See Open Method.
This Class was only included in MBS Plugins 2.2. I gave it to Realsoftware to implement it for RB 4.5.

Available as integer

method, Serial Port Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: returns allways 0. Windows: returns allways 0.
Function: How much bytes are in the buffer?
Example:
dim n as Integer, s as String

n = serPort.Available() // how much?
if n > 0 then
s = serPort.Read(n) // read n bytes
recieved.text = recieved.text + s // show in editfield
end if

Close

method, Serial Port Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: does nothing. Windows: does nothing.
Function: Closes a serial port.
Example: ser.close

Open(portIdx as Integer, baud as Integer, bufSize as Integer) as Boolean

method, Serial Port Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: returns allways false. Windows: returns allways false.
Function: Opens a serial port.
Example:
ser = new MacClassicSerial
if not ser.Open(0, 57600, 2000) then
MsgBox "Open failed. Remeber that the MacClassicSerial class is only for Mac Classic and doesn't work for Mac OS X."
return false
end
Notes:
portIdx is the number of the serial port.
See the system.serialport functions in Realbasic's onlinehelp to find out about installed serial ports.
Baudrate can be: 300 to 57600, 115200 or 230000. If you use baudrate=0 than the external device will set the speed.
Buffer will be the size of the readbuffer. Make it big enough so don't loose data.
Returns true if serial port open.

Read(buffer as MemoryBlock, byteCnt as Integer) as Integer

method, Serial Port Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: does nothing. Windows: does nothing.
Function: Read some bytes into the memoryblock. Returns how many bytes were read.

Read(byteCnt as Integer) as String

method, Serial Port Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: returns allways "". Windows: returns allways "".
Function: Read some bytes and return as string

Write(data as MemoryBlock, byteCnt as Integer) as Integer

method, Serial Port Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: returns allways 0. Windows: returns allways 0.
Function: Writes data from a memoryblock to the serial port. Returns how many bytes were written.

Write(data as String) as Integer

method, Serial Port Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: returns allways 0. Windows: returns allways 0.
Function: Writes data from a string to the serial port. Returns how many bytes were written.

MacClassicSerialAvailable as boolean

global method, Serial Port Mo, 15. Jul 2002
Mac OS Classic: Works. Mac OS Carbon: Works. Windows: Works.
Function: Is the MacClassicSerial Class working?
Notes: On Carbon applications running on Mac OS Classic you will need to call this function in order to load the classic serial library!

Contact

Written 2002 by Christian Schmitz. Feel free to ask or report mistakes to realbasic@macsw.de.
Thanks.

This resource fork intentionally left blank ˇˇ